From ca9ac098216fd89f030038522b89255102d545fd Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 15 Nov 2003 13:26:37 +0000 Subject: [PATCH] Use wfMsg()'s parameters --- includes/SpecialUserlogin.php | 29 +++++++++-------------------- includes/SpecialWantedpages.php | 2 +- includes/SpecialWatchlist.php | 2 +- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 28d6d2d7d1..062e7d09af 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -29,8 +29,7 @@ function wfSpecialUserlogin() global $wgOut, $wpEmail, $wpName; if ("" == $wpEmail) { - $m = str_replace( "$1", $wpName, wfMsg( "noemail" ) ); - mainLoginForm( $m ); + mainLoginForm( wfMsg( "noemail", $wpName ) ); return; } @@ -50,9 +49,7 @@ function wfSpecialUserlogin() $wgOut->setRobotpolicy( "noindex,nofollow" ); $wgOut->setArticleFlag( false ); - $m = str_replace( "$1", $u->getName(), wfMsg( "accmailtext" ) ); - $m = str_replace( "$2", $u->getEmail(), $m ); - $wgOut->addWikiText( $m ); + $wgOut->addWikiText( wfMsg( "accmailtext", $u->getName(), $u->getEmail() ) ); $wgOut->returnToMain( false ); $u = 0; @@ -71,8 +68,7 @@ function wfSpecialUserlogin() } $wgUser = $u; - $m = str_replace( "$1", $wgUser->getName(), wfMsg( "welcomecreation" ) ); - successfulLogin( $m ); + successfulLogin( wfMsg( "welcomecreation", $wgUser->getName() ) ); } @@ -133,8 +129,7 @@ function wfSpecialUserlogin() $u = User::newFromName( $wpName ); $id = $u->idForName(); if ( 0 == $id ) { - $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) ); - mainLoginForm( $m ); + mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) ); return; } $u->setId( $id ); @@ -158,8 +153,7 @@ function wfSpecialUserlogin() $u->setOption( "rememberpassword", $r ); $wgUser = $u; - $m = str_replace( "$1", $wgUser->getName(), wfMsg( "loginsuccess" ) ); - successfulLogin( $m ); + successfulLogin( wfMsg( "loginsuccess", $wgUser->getName() ) ); } /* private */ function mailPassword() @@ -174,8 +168,7 @@ function wfSpecialUserlogin() $u = User::newFromName( $wpName ); $id = $u->idForName(); if ( 0 == $id ) { - $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) ); - mainLoginForm( $m ); + mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) ); return; } $u->setId( $id ); @@ -185,8 +178,7 @@ function wfSpecialUserlogin() return; } - $m = str_replace( "$1", $u->getName(), wfMsg( "passwordsent" ) ); - mainLoginForm( $m ); + mainLoginForm( wfMsg( "passwordsent", $u->getName() ) ); } @@ -196,8 +188,7 @@ function wfSpecialUserlogin() global $wgPasswordSender; if ( "" == $u->getEmail() ) { - $m = str_replace( "$1", $u->getName(), wfMsg( "noemail" ) ); - mainLoginForm( $m ); + mainLoginForm( wfMsg( "noemail", $u->getName() ) ); return; } $np = User::randomPassword(); @@ -209,9 +200,7 @@ function wfSpecialUserlogin() $ip = getenv( "REMOTE_ADDR" ); if ( "" == $ip ) { $ip = "(Unknown)"; } - $m = str_replace( "$1", $ip, wfMsg( "passwordremindertext" ) ); - $m = str_replace( "$2", $u->getName(), $m ); - $m = str_replace( "$3", $np, $m ); + $m = wfMsg( "passwordremindertext", $ip, $u->getName(), $np ); mail( $u->getEmail(), wfMsg( "passwordremindertitle" ), $m, "MIME-Version: 1.0\r\n" . diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index af8aac4094..834d68cd70 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -42,7 +42,7 @@ function wfSpecialWantedpages() $nt = Title::newFromDBkey( $obj->bl_to ); $plink = $sk->makeBrokenLink( $nt->getPrefixedText(), "" ); - $nl = str_replace( "$1", $obj->nlinks, wfMsg( "nlinks" ) ); + $nl = wfMsg( "nlinks", $obj->nlinks ); $nlink = $sk->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl, "target=" . $nt->getPrefixedURL() ); diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index d49bfd498d..e5749e12cd 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -9,7 +9,7 @@ function wfSpecialWatchlist() $fname = "wfSpecialWatchlist"; $wgOut->setPagetitle( wfMsg( "watchlist" ) ); - $sub = str_replace( "$1", $wgUser->getName(), wfMsg( "watchlistsub" ) ); + $sub = wfMsg( "watchlistsub", $wgUser->getName() ); $wgOut->setSubtitle( $sub ); $wgOut->setRobotpolicy( "noindex,nofollow" ); -- 2.20.1